package com.zhongen.admin.api.feign;

import com.zhongen.admin.api.entity.SysPost;
import com.zhongen.common.core.constant.SecurityConstants;
import com.zhongen.common.core.constant.ServiceNameConstants;
import com.zhongen.common.core.util.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestHeader;

import java.util.List;

/**
 * 查询岗位相关
 */
@FeignClient(contextId = "remotePostService", value = ServiceNameConstants.UPMS_SERVICE)
public interface RemotePostService {

	/**
	 * 查询岗位信息
	 * @param from 内部调用标志
	 * @return R
	 */
	@GetMapping("/post/list/inner")
	R<List<SysPost>> listPosts(@RequestHeader(SecurityConstants.FROM) String from);

	/**
	 * 新增岗位信息
	 * @param sysPost 岗位信息
	 * @param from 内部调用标志
	 * @return R
	 */
	@PostMapping("/post/inner")
	R<Boolean> savePost(SysPost sysPost, @RequestHeader(SecurityConstants.FROM) String from);

}
